import React, { useState } from 'react'

export default function Hello () {
  const [count, setCount] = useState(0)

  function increment () {
    // setCount(1)  直接赋值
    setCount(preCount => preCount + 1)
  }

  return (
    <div>
      <button onClick={increment}> + </button>
      <p> {count} </p>
    </div>
  )
}

